import { createRouter, createWebHashHistory } from 'vue-router'
// createWebHistory
const routes = [
  {
    path: '/',
    redirect: '/home',
  },
  {
    path: '/home',
    component: () => import('@/views/home/index'),
    meta: { isTrue: true },
  },
  {
    path: '/cate',
    component: () => import('@/views/cate/index'),
    meta: { isTrue: true },
  },
  {
    path: '/detail',
    component: () => import('@/views/detail/index'),
    meta: { isTrue: true },
  },
  {
    path: '/cart',
    component: () => import('@/views/cart/index'),
    meta: { isTrue: false },
  },
  {
    path: '/my',
    component: () => import('@/views/my/index'),
    meta: { isTrue: false },
  },
  {
    path: '/order',
    component: () => import('@/views/order/index'),
    meta: { isTrue: false },
  },
  {
    path: '/noticehelp',
    component: () => import('@/views/noticehelp/index'),
    meta: { isTrue: false },
  },
]

// router.beforeEach((to, from, next) => {
//   if (to.meta.requireAuth) {
//   } else {
//     next()
//   }
// })

const router = createRouter({
  history: createWebHashHistory(process.env.BASE_URL),
  routes,
})

export default router
